#include "ReflectStage.h"

namespace egg{

    ReflectStage::ReflectStage(){
        mQuad=gGeometryLib.getGeometry("quad");
        mShader=gShaderLib.getShader("sphereMap");
        mParamMap.bindShader(mShader);
        mParamMap.bindNumericParam("uni_vec4_frustum");
        mParamMap.bindTextureParam("uni_sampler2D_gNormal");
        mParamMap.bindTextureParam("uni_sampler2D_gPosition");
        mSphereMap=mParamMap.getTextureParam("uni_sampler2D_sphere");
    }

    void ReflectStage::doRender(const FrameEvent& evt,TexturePtr sphereMap){
        mSphereMap->mTexture=sphereMap;
        mParamMap._commitParamsForce();
        mQuad->draw();
    }

}